package com.hxkcloud.nurse.utils;

import android.app.Activity;
import android.view.WindowManager;

/**
 * Created by kaka_xiao on 2016/6/28.
 * instructions:弹出隐藏popup时改变亮度
 */
public class BrightnessUtils {
    public static void lightOff(Activity activity) {
        WindowManager.LayoutParams lp = activity.getWindow().getAttributes();
        lp.alpha = .6f;
        activity.getWindow().setAttributes(lp);
    }

    public static void lightOn(Activity activity) {
        WindowManager.LayoutParams lp = activity.getWindow().getAttributes();
        lp.alpha = 1.0f;
        activity.getWindow().setAttributes(lp);
    }
}
